package com.maysham.tripod;

import com.maysham.tripod.config.CoderAuditorImpl;
import com.maysham.tripod.model.User;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.domain.AuditorAware;
import org.springframework.data.mongodb.config.EnableMongoAuditing;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

@SpringBootApplication
@EnableMongoAuditing(auditorAwareRef = "myAuditorProvider")
@EnableMongoRepositories
public class Application {

    @Bean
    public AuditorAware<User> myAuditorProvider() {
        return new CoderAuditorImpl();
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
